/*
 * Copyright 2009 BioTeam Inc
 * 
 * Licensed under License GNU LESSER GENERAL PUBLIC LICENSE version 3.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package net.bioteam.appweb.model;

import java.io.InputStream;
import java.util.Map;

import net.bioteam.appweb.TestConfig;
import net.bioteam.appweb.acd.AcdToProgram;
import net.bioteam.appweb.model.meta.Entry;
import net.bioteam.appweb.submit.DefaultCommandLineGenerator;
import net.bioteam.appweb.submit.ProgramValueBean;
import net.sf.ehcache.CacheManager;
import junit.framework.TestCase;

public class RunMetaTest extends TestCase {

	public RunMetaTest(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		TestConfig.init();
		
		 BeanshellProgramModifier modifier=new BeanshellProgramModifier();
         ProgramBuilder.modifiers.add(modifier);
	}

	protected void tearDown() throws Exception {
		TestConfig.shutdown();
	}

	
	public void testRunMeta() throws Exception
	{
		Program program;
		Parameter p;
		DefaultCommandLineGenerator generator = new DefaultCommandLineGenerator();
		String cmdline, expected;
		ProgramValueBean bean;
		ProgramBuilder.cache.remove("blastall");
		

		program = ProgramBuilder.getProgram("blastall");
		bean = new ProgramValueBean(program);
		
		Map<String, Entry> runMeta=program.getMetaData();
		Entry entry=runMeta.get("_DRMMANATIVE");
		assertTrue(entry.isDisplay());
		entry=runMeta.get("_DRMMACATEGORY");
		assertTrue(!entry.isDisplay());
		

		
		assertNotNull(bean.getValue("_DRMMANATIVE"));
		assertNotNull(bean.getValue("_DRMMACATEGORY"));
		
		
	}
}
